
function Env (enclosingEnv)
{
    this.enclosingEnv = enclosingEnv;
    this.vars = {};

    function lookup(symbol)
    {
	var name = symbol.name;
	var value = vars[name];
	if (value != undefined)
	    return value;
	if (enclosingEnv != null)
	    return enclosingEnv.lookup(symbol);
	throw ("The variable " + name + " is undefined.");
    }

    function extend (symbol, value)
    {
	return this.vars[symbol.name] = value;
    }
}
